package com.flute.tools.util.performance;

public class TimeScope implements Comparable<TimeScope> {
	private long up;
	private long low;

	public TimeScope() {
		super();
	}

	public TimeScope(long low, long up) {
		super();
		this.up = up;
		this.low = low;
	}

	public long getUp() {
		return up;
	}

	public void setUp(long up) {
		this.up = up;
	}

	public long getLow() {
		return low;
	}

	public void setLow(long low) {
		this.low = low;
	}

	@Override
	public int hashCode() {
		return String.valueOf(up + low).hashCode();
	}

	public boolean equals(Object obj) {
		return hashCode() == obj.hashCode();
	}

	@Override
	public int compareTo(TimeScope o) {
		if (up < o.up) {
			return -1;
		} else if (up == o.up) {
			return 0;
		} else {
			return 1;
		}
	}
}
